package com.dearbinge.data.service.impl.commodityspec;

import com.dearbinge.data.api.commodityspec.CommoditySpecService;
import com.dearbinge.data.dao.commodityspec.CommoditySpecMapper;
import com.dearbinge.data.pojo.commodityspec.CommoditySpec;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("commoditySpecService")
public class CommoditySpecServicelmpl implements CommoditySpecService {

    @Autowired
    private CommoditySpecMapper commoditySpecMapper;

    @Override
    public Integer insert (CommoditySpec commoditySpec) {
        Integer integer = commoditySpecMapper.insert(commoditySpec);
        return integer;
    }

    @Override
    public Integer update (CommoditySpec commoditySpec) {
        Integer integer = commoditySpecMapper.update(commoditySpec);
        return integer;
    }

    @Override
    public Integer delete (Integer id) {
        Integer integer = commoditySpecMapper.delete(id);
        return integer;
    }

    @Override
    public List<CommoditySpec> selectByCommodityId (Integer commodityId) {
        List<CommoditySpec> commoditySpec = commoditySpecMapper.listByCommodityId(commodityId);
        return commoditySpec;
    }

    @Override
    public CommoditySpec selectById (Integer id) {
        CommoditySpec commoditySpec = commoditySpecMapper.selectById(id);
        return commoditySpec;
    }
}
